<?php

class Ialbum_Widget_PhotosInAlbumController extends Engine_Content_Widget_Abstract
{
  public function indexAction()
  {
	if (!Engine_Api::_()->core()->hasSubject()) {
      return $this->setNoRender();
    }
    $this->view->subject = $subject = Engine_Api::_()->core()->getSubject();
    if(!($subject instanceof Album_Model_Photo))
  	{
      return $this->setNoRender();
    }
	//get all photo
	$this->view->paginator = $paginator = $subject->getTable()->getPhotoPaginator(array(
      'album_id' => $subject->album_id,
    ));
     $paginator->setItemCountPerPage(1000);
     $this->view->count = $count = $paginator->count();
	 if($count <= 0){
	    return $this->setNoRender();
	 }
  }
}
